/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** *****************************************************************************************************
 * \file     Wdg_Irq.c                                                                                  *
 * \brief    AUTOSAR 4.3.1 MCAL WDG Driver                                                              *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/07/17     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/

#include "Wdg_Irq.h"
#include "Wdg.h"
#include "irq_num.h"
#include "RegHelper.h"
#ifdef __cplusplus
extern "C" {
#endif
/* PRQA S 2741 EOF */
/********************************************************************************************************
 *                                 Global Macro definition                                              *
 *******************************************************************************************************/
/**
 *  \name WDG Driver ID Info
 *  @{
 */
/** \brief SemiDriver Instruments Vendor ID */
#define WDG_IRQ_C_VENDOR_ID    0x8C
/* @} */
/**
 *  \name WDG Driver Module AUTOSAR Version Info
 *
 *  Defines for WDG Driver AUTOSAR version used for compatibility checks
 *  @{
 */
/** \brief AUTOSAR Major version specification implemented by WDG Driver */
#define WDG_IRQ_C_AR_RELEASE_MAJOR_VERSION    4
/** \brief AUTOSAR Minor  version specification implemented by WDG Driver */
#define WDG_IRQ_C_AR_RELEASE_MINOR_VERSION    3
/** \brief AUTOSAR Patch version specification implemented by WDG Driver */
#define WDG_IRQ_C_AR_RELEASE_REVISION_VERSION 1
/* @} */
/**
 *  \name WDG Driver Module SW Version Info
 *
 *  Defines for WDG Driver version used for compatibility checks
 *  @{
 */
/** \brief Driver Implementation Major Version */
#define WDG_IRQ_C_SW_MAJOR_VERSION    1
/** \brief Driver Implementation Minor Version */
#define WDG_IRQ_C_SW_MINOR_VERSION    0
/** \brief Driver Implementation Patch Version */
#define WDG_IRQ_C_SW_PATCH_VERSION    0
/* @} */
/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/
#if ((WDG_INSTANCE1_SUPPORT == STD_ON)\
  || (WDG_INSTANCE2_SUPPORT == STD_ON)\
  || (WDG_INSTANCE3_SUPPORT == STD_ON)\
  || (WDG_INSTANCE4_SUPPORT == STD_ON)\
  || (WDG_INSTANCE5_SUPPORT == STD_ON)\
  || (WDG_INSTANCE6_SUPPORT == STD_ON)\
  || (WDG_INSTANCE8_SUPPORT == STD_ON)\
  || (WDG_INSTANCE9_SUPPORT == STD_ON))

#define WDG_START_SEC_CODE
#include "Wdg_MemMap.h"

#if (WDG_INSTANCE1_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance1 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance1(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance1 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance1)
{
    Wdg_140_CommonInterrupt(((uint8)1U));
}
#endif /*WDG_INSTANCE1_SUPPORT*/
#if (WDG_INSTANCE2_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance2 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance2(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance2 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance2)
{
    Wdg_140_CommonInterrupt(((uint8)2U));
}
#endif /*WDG_INSTANCE2_SUPPORT*/
#if (WDG_INSTANCE3_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance3 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance3(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance3 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance3)
{
    irq_log_check_valid(WDT3_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)3U));
}
#endif /*WDG_INSTANCE3_SUPPORT*/
#if (WDG_INSTANCE4_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance4 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance4(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance4 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance4)
{
    irq_log_check_valid(WDT4_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)4U));
}
#endif /*WDG_INSTANCE4_SUPPORT*/
#if (WDG_INSTANCE5_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance5 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance5(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance5 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance5)
{
    irq_log_check_valid(WDT5_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)5U));
}
#endif /*WDG_INSTANCE5_SUPPORT*/
#if (WDG_INSTANCE6_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance6 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance6(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance6 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance6)
{
    irq_log_check_valid(WDT6_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)6U));
}
#endif /*WDG_INSTANCE6_SUPPORT*/
#if (WDG_INSTANCE8_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance8 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance8(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance8 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance8)
{
    irq_log_check_valid(WDT8_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)8U));
}
#endif /*WDG_INSTANCE8_SUPPORT*/
#if (WDG_INSTANCE9_SUPPORT == STD_ON)
/** *****************************************************************************************************
 * \brief TThis service for the WDG instance9 interrupt handle
 *
 * \verbatim
 * Syntax             : void Wdg_Isr_Instance9(void)
 *
 * Service ID[hex]    : none
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : This service for the WDG instance9 interrupt handle
 * \endverbatim
 * Traceability       : SWSR_WDG_072 SWSR_WDG_074 SWSR_WDG_079 SW_SM003 SW_SM004 SW_SM006
 *******************************************************************************************************/
ISR(Wdg_Isr_Instance9)
{
    irq_log_check_valid(WDT9_WDT_INTR_NUM);
    Wdg_140_CommonInterrupt(((uint8)9U));
}
#endif /*WDG_INSTANCE9_SUPPORT*/

#define WDG_STOP_SEC_CODE
#include "Wdg_MemMap.h"
#endif /* WDG_INSTANCE1_SUPPORT||WDG_INSTANCE2_SUPPORT||WDG_INSTANCE3_SUPPORT||WDG_INSTANCE4_SUPPORT||WDG_INSTANCE5_SUPPORT||WDG_INSTANCE6_SUPPORT||WDG_INSTANCE8_SUPPORT */
#ifdef __cplusplus
}
#endif
/* End of file */
